#pragma once
#include "EventDispatcher.h"
#include "Controller.h"
#include <math.h>

class GTimer :
	public EventDispatcher
{
public:

	static Event TIMER_EVENT;

	GTimer(void);
	~GTimer(void);

	bool running;
	unsigned int repeatCount;
	unsigned int currentCount;

	void setTimer(unsigned int ms, unsigned int repeatCount);
	void start();
	void stop();

protected:
	void update(Event *e);
	FatPointer <GTimer, void> *updatePtr;
	double CPF;
	double cyclesPassed;
	unsigned int ticks;
	unsigned int i;
};
